import request from '@/utils/request'

// 查询物料替代关系列表
export function listReplace(query) {
  return request({
    url: '/base/replace/list',
    method: 'get',
    params: query
  })
}

// 查询物料替代关系详细
export function getReplace(replaceId) {
  return request({
    url: '/base/replace/' + replaceId,
    method: 'get'
  })
}

// 新增物料替代关系
export function addReplace(data) {
  return request({
    url: '/base/replace',
    method: 'post',
    data: data
  })
}

// 修改物料替代关系
export function updateReplace(data) {
  return request({
    url: '/base/replace',
    method: 'put',
    data: data
  })
}

// 删除物料替代关系
export function delReplace(replaceId) {
  return request({
    url: '/base/replace/' + replaceId,
    method: 'delete'
  })
}

// 导出物料替代关系
export function exportReplace(query) {
  return request({
    url: '/base/replace/export',
    method: 'get',
    params: query
  })
}